import type { LoginDataType } from '@/type/user'
import { defineStore } from 'pinia'
import { ref, computed } from 'vue'

export const useUserStore = defineStore(
  'userStore',
  () => {
    const user = ref<LoginDataType>()
    const clear = () => {
      user.value = undefined
    }
    return { user, clear }
  },
  {
    unistorage: true,
  }
)
